﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using CDC.SampleShell.Applications;

namespace CDC.SampleShell.Presentation.Content
{
    /// <summary>
    /// Interaction logic for ReportsTab.xaml
    /// </summary>
    public partial class ReportsTab : UserControl
    {
        public ReportsTab()
        {
            InitializeComponent();
        }

        private void canvasList_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            ReportsViewModel vm = (panelAnalysis.DataContext as ReportsViewModel);
            if (vm.ReportFileNamesView.CurrentItem != null)
            {
                FileInfo fi = vm.ReportFileNamesView.CurrentItem as FileInfo;

                Uri uri = new Uri(fi.FullName.Replace(".cvs7", ".html"));
                browser.Source = uri; // new System.Uri((panelAnalysis.DataContext as ReportsViewModel).HtmlSource);
            }
        }
    }
}
